##
## Makefile
## Login : <ctaf42@localhost.localdomain>
## Started on  Sat Feb  9 15:00:23 2008
## $Id$
##
## Copyright (C) 2008
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##

##############################
# Complete this to make it ! #
##############################
NAME 	= cairo-dock-installer	# Name of executable file
SRC	= main.c test.c
	      # List of *.c
INCL  	= test.h	# List of *.h
################
# Optional add #
################
IPATH   = -I.           # path of include file
OBJOPT  = -g -O2 -Wall -Wstrict-prototypes       # option for obj
EXEOPT  = -g -O2 -Wall -Wstrict-prototypes       # option for exe (-lefence ...)
LPATH   = -L.           # path for librairies ...

#####################
# Macro Definitions #
#####################
CC 	= gcc
CXX 	= g++
MAKE 	= make
SHELL	= /bin/sh
OBJS 	= $(SRC:.c=.o) 	# WARNING!!! Be careful of your file extensions.
RM 	= /bin/rm -f
COMP	= gzip -9v
UNCOMP	= gzip -df
STRIP	= strip

CFLAGS  = $(OBJOPT) $(IPATH) `pkg-config --cflags gtk+-2.0 vte`
LDFLAGS = $(EXEOPT) $(LPATH) `pkg-config --libs gtk+-2.0 vte`

.SUFFIXES: .h.Z .c.Z .h.gz .c.gz .c.z .h.z

##############################
# Basic Compile Instructions #
##############################

all:	$(NAME)
$(NAME): $(OBJS) $(SRC) $(INCL)
	$(CC) $(OBJS) $(LDFLAGS) -o $(NAME)
#	$(STRIP) ./$(NAME) # if you debug ,don't strip ...

install: all
	mkdir /opt/cairo-dock/
	mkdir /opt/cairo-dock/cairo-dock-svn
	cp -r dockinstaller /usr/local/bin
	chmod 777 /opt/cairo-dock
	cp -r cairo-dock_svn.sh /opt/cairo-dock/
	chmod 647 /opt/cairo-dock/cairo-dock_svn.sh
depend:
	gcc $(IPATH) -MM $(SRC)
clean:
	-$(RM) $(NAME) $(OBJS) *~
fclean:
	-$(RM) $(NAME)
comp: clean
	$(COMP) $(INCL) $(SRC)
ucomp:
	$(UNCOMP) $(SRC) $(INCL)

check-syntax:
	$(MAKE) syntax-target CFLAGS="-fsyntax-only"

syntax-target: $(CHK_SOURCES:.c=.o)

.c.Z.c .h.Z.h .c.gz.c .h.gz.h .c.z.c .h.z.h :
	 -$(UNCOMP) $<

.c.o:
	$(CC) $(CFLAGS) -c $<
.cc.o:
	$(CXX) $(CFLAGS) -c $<
################
# Dependencies #
################
